/*
 * Unite.h
 *
 *  Created on: Jun 9, 2013
 *      Author: juliendubois
 */

#ifndef UNITE_H_
#define UNITE_H_

#include "Attaque/Attaque.h"
#include "Equipement/Equipement.h"
#include <map>

using Attribut::Endurance;
using Attribut::AttributArmure;
using Attribut::Precision;
using Attribut::Esquive;
using Attaque::Attaque;
using Equipement::Arme;

using std::map;
using std::string;

namespace Unite {

class Unite {
protected:
	Endurance endurance;
	Precision precision;

	map<string, Arme> armes;

public:
	Unite(double endurance, double precision) : endurance(endurance), precision(precision), armes() {};
	virtual ~Unite() {};

	virtual bool encaisseAttaque(Attaque attaque);
};

class Batiment : public Unite {
protected:
	AttributArmure armure;

public:
	Batiment(double endurance, double precision, double armure = 30.0) : Unite(endurance, precision), armure(armure) {};
	virtual ~Batiment() {};

	virtual bool encaisseAttaque(Attaque attaque);
};

class UniteMobile : public Unite {
protected:
	unsigned int distanceDeplacement;
	Esquive esquive;

public:
	UniteMobile(double endurance, double precision, unsigned int distanceDeplacement, double esquive) : Unite(endurance, precision), esquive(esquive) {
		this->distanceDeplacement = distanceDeplacement;
	};
	virtual ~UniteMobile();

	virtual bool encaisseAttaque(Attaque attaque);
};

}


#endif /* UNITE_H_ */
